import { ApiCall } from "tsrpc";
import { ReqList, ResList } from "../../../shared/master/shop/PtlList";
import god from "../../../god";

export default async function (call: ApiCall<ReqList, ResList>) {
    god.check();
    let bagArry = god.sellBag.items;
    let resArry: any = [];
    for (let index = 0; index < bagArry.length; index++) {
        const element = bagArry[index];
        if (!element) {
            resArry.push(undefined);
        } else {
            resArry.push({ name: element.getStyleName(), type: element.min_type, cont: element.num, price: element.value })
        }
    }
    call.succ({ nextTime: god.nextAddTime, list: resArry })
}